﻿using System;
using System.Linq;
using NGourd.Core;
using System.Reflection;
using NGourd.Core.Reports;
using System.IO;
using NGourd.Core.Runners;
using NGourd.CLI;

namespace NGourd
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            bool allPassed = false;
            using (ConsoleColorer.RestorePoint)
            {
                try
                {
                    PrintBanner();
                    allPassed = new Runner(CommandLineParser.Parse<NGourdOptions>(args)).Run();
                    
                }
                catch (Exception ex)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine(ex);
                }
            }
            Environment.Exit(allPassed ? 0 : -1);
        }

        private static void PrintBanner()
        {
            Console.WriteLine("NGourd.exe v0.2 [experimental]");
        }
    }
}
